package ru.dc.object.commands;

/**
 * <pre>
 * User: Penkov Vladimir
 * Date: 08.10.2010
 * Time: 18:38:56
 * </pre>
 */
public class Quit extends Command {

    private String nick;

    @Override
    public String generateCommand() {
        return getActualCommandName()+" "+getNick();
    }

    @Override
    public String getActualCommandName() {
        return "$Quit";
    }

    @Override
    public void parseCommand() {
        if (getCommand().length()>6) {
            setNick(getCommand().substring(6));
        }
        else {
            setNick(null);
        }
    }

    public String getNick() {
        return nick;
    }

    public void setNick(String nick) {
        this.nick = nick;
    }


}
